class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  include SessionsHelper
  def one_bill_users_ids(bill)
      containers = Container.where(bill_id: bill.id).all
      ids ||= []
      containers.each do |container|
        ids << container.user_id
      end
    return ids
  end

  def generate_username_default_icon(name)
    LetterAvatar.generate  Pinyin.t(name), 200
  end
end
